﻿
@model IEnumerable<Developer.Entity.CycleModel>

@{
    ViewBag.Title = "Index";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
    var i = 1;
}
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 访问统计 <span class="c-gray en">&gt;</span> 回收概览统计 <a class="btn btn-success radius r" id="btn-refresh" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">

    <div class="mt-20">

        <div id="container" style="min-width:700px;height:400px"></div>
        <div style="clear:both;"></div>
    </div>
</div>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/highcharts.js"></script>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/modules/exporting.js"></script>
<script src="~/Assets/Plugs/HUI/Highcharts/4.1.7/js/highcharts-3d.js"></script>

<script type="text/javascript">
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'pie',
                options3d: {
                    enabled: true,
                    alpha: 45,
                    beta: 0
                }
            },
            title: {
                text: '[回收]所有型号访问记录饼图'
            },
            tooltip: {
                pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    depth: 35,
                    dataLabels: {
                        enabled: true,
                        format: '{point.name}'
                    }
                }
            },
            series: [{
                type: 'pie',
                name: '型号',
                data: [
                    @{
                        string array = string.Empty;
                        foreach(var color in Model)
                        {
                            array += "['" + color.CycleBrand.Name  + color.Name + "'," + color.Statistic + "],";
                        }
                    }
                    @Html.Raw(array)
                ]
            }]
        });
    });
</script>